//
// Created by DELL on 2023/3/27.
//

#include <iostream>
#include "MemoryPool.h"
#include "tracknew.hpp"


int main()
{
    TrackNew::reset();
    TrackNew::trace(true);

    MemoryPool pool;

    void* p[5]{};
    for (int i = 0; i < 5; ++i)
    {
        p[i] = pool.allocate(256);
    }

    pool.free(p[1]);
    pool.free(p[0]);

    auto p1 = pool.allocate( 11 << 20);
    auto p2 = pool.allocate(512);
    auto p3 = pool.allocate(1 << 20);
    auto p4 = pool.allocate(1 << 20);
    auto p5 = pool.allocate(1 << 20);
    auto p6 = pool.allocate(1 << 20);
    auto p7 = pool.allocate(1 << 20);
    auto p8 = pool.allocate(1 << 20);

    TrackNew::status();

}